package com.chenyi.web.controller.shop;

import com.chenyi.common.annotation.UserRequired;
import com.chenyi.common.core.controller.BaseController;
import com.chenyi.system.service.ISysDictDataService;
import com.chenyi.system.service.ISysDictTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 数据字典信息
 *
 * @author wangkh
 */
@RestController
@RequestMapping("/shop/dict/data")
public class ShopDictDataController extends BaseController {

    @Autowired
    private ISysDictDataService dictDataService;

    @Autowired
    private ISysDictTypeService dictTypeService;
    /**
     * 根据字典类型查询字典数据信息
     */
    @UserRequired
    @GetMapping(value = "/type/{dictType}")
    public ResponseEntity<Object> dictType(@PathVariable String dictType)
    {
        return ResponseEntity.ok(dictTypeService.selectDictDataByType(dictType));
    }

}
